create table RoomType
(
	 [RoomTypeId] int identity(1, 1) primary key
	,[RoomTypeName] nvarchar(128)
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

CREATE PROCEDURE RoomTypeGet
	@RoomTypeId int	
AS
SELECT *
FROM [RoomType]
WHERE [RoomType].[RoomTypeId] = @RoomTypeId
GO

CREATE PROCEDURE RoomTypeList
AS
SELECT *
FROM [RoomType]
ORDER BY [Status]
GO

CREATE PROCEDURE RoomTypeInsert
	 @RoomTypeName nvarchar(128)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO RoomType (
	 [RoomTypeName]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @RoomTypeName
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE RoomTypeUpdate
	@RoomTypeId int, 
	@RoomTypeName nvarchar(128), 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 
AS

UPDATE RoomType SET
	   [RoomTypeName] = @RoomTypeName
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [RoomType].[RoomTypeId] = @RoomTypeId
GO

CREATE PROCEDURE RoomTypeDelete
	@RoomTypeId int 
AS
DELETE FROM RoomType
WHERE [RoomType].[RoomTypeId] = @RoomTypeId
GO